<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        IPPI Admin Page
        <small>Events</small>
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <!-- Main row -->
    <div class="row">
        <!-- right col (We are only adding the ID to make the widgets sortable)-->
        <section class="col-lg-6 connectedSortable">
            
            <!-- Map box -->
            <div class="box box-primary">
                <div class="box-body no-padding">
                    <!--<div id="world-map" style="height: 300px;"></div>-->
                    <div class="table-responsive">
                        <!-- .table - Uses sparkline charts-->
                        <table class="table table-striped">
                            <tr>
                                <th>No</th>
                                <th>Judul</th>
                                <th>Datecreated</th>
                                <th>Action</th>
                            </tr>
                            <?php
                            if($this->uri->segment(3)){
                                $i=$this->uri->segment(3)+1;
                            }
                            else $i=1;
                            foreach($list_data as $r):
                            ?>
                            <tr>
                                <td><?php echo $i++;?></td>
                                <td><?php echo $r->judul;?></td>
                                <td><?php
                                $newDate = date("d M Y <b>h:m:s<b>", strtotime($r->datecreated));
                                echo $newDate;
                                ?></td>
                                <td>
                                <a href="<?php echo site_url()?>admin_event/detail/<?php echo $r->id_event;?>">detail</a> | 
                                <a href="<?php echo site_url()?>admin_event/delete/<?php echo $r->id_event;?>" onclick="return confirm('Apakah anda yakin akan menghapus data ini?')">hapus</a>
                                </td>
                            </tr>
                            <?php
                            endforeach
                            ?>
                            
                        </table><!-- /.table -->
                    </div>
                </div><!-- /.box-body-->
            </div>
            <!-- /.box -->
            
            <div class="box-tools">
                <?php echo $pagination;?>
            </div>
            <a href="<?php echo site_url()?>admin_event/add" class="btn btn-primary btn-sm">Tambah Event</a>
        </section><!-- right col -->
    </div><!-- /.row (main row) -->
</section><!-- /.content -->